package com.luckycoder.util;

import com.luckycoder.util.Cal;
import com.luckycoder.util.MyInvocationHandle;
import com.luckycoder.util.impl.CalculatorImpl;

public class Test {
    public static void main(String[] args) {
        //创建委托对象
        Cal calculatorImpl = new CalculatorImpl();
        //创建代理类
        MyInvocationHandle myInvocationHandle = new MyInvocationHandle();
        Cal proxy_cal = (Cal) myInvocationHandle.bind(calculatorImpl);
        proxy_cal.add(2, 2);
        proxy_cal.sub(2, 2);
        proxy_cal.mul(2, 2);
        proxy_cal.del(2, 2);

        System.out.println("GG");
    }
}
